﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using JESAI.Application.Abstractions.Admin;
using JESAI.Application.Abstractions.Admin.Dtos.Logging;
using JESAI.Application.Abstractions.Dtos;
using JESAI.Framework.Filters;
using System.Linq;

namespace Bucket.Admin.Web.Controllers
{
    /// <summary>
    /// 日志管理
    /// </summary>
    [ApiController]
    [Authorize("permission")]
    [IgnoreResultHandlerAttribute]
    public class LoggingController : ControllerBase
    {
        private readonly ILoggingService _loggingService;

        /// <summary>
        /// Ctor
        /// </summary>
        /// <param name="sqlSugarDbContextFactory"></param>
        public LoggingController(ILoggingService loggingService)
        {
            _loggingService=loggingService;
        }
        /// <summary>
        /// 查询日志列表
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpGet("/Api/QueryLogList")]
        public BasePageOutput<List<LoggingDto>> QueryLogList([FromQuery] QueryLogListInput input)
        {            
            var result = _loggingService.QueryLogList(input);
            return result;
        }
    }
}